package com.base.pd.agent;

import java.util.Random;

public class AgentJoss extends Agent{

	private static Random r = new Random(); 
	
	private static int DEFECT_VALUE = 10 ; 
	
	private boolean nextMove ; 
	
	public AgentJoss() {
		super("Agent Joss","Developed by MADinow");
	}

	@Override
	public boolean cooperate() {
		return this.nextMove ;
	}

	@Override
	public void update(int round, boolean myMove, boolean otherMove,
			int myScore, int otherScore) {
		this.nextMove = (otherMove && r.nextInt(DEFECT_VALUE) != 0); 
	}

	@Override
	public void init() {
		this.nextMove = true ; 
	}

}
